package com.cloudkinto.service.product;

import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.entity.ProductInfoDo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudkinto.service.orderoutput.vo.OrderOutputProductAddReq;
import com.cloudkinto.service.product.vo.ProductAddReq;
import com.cloudkinto.service.product.vo.ProductDetailRes;
import com.cloudkinto.service.product.vo.ProductUpdateReq;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  service接口
 * </p>
 * @author 张永远
 * @since 2020-06-04
 */
public interface ProductInfoService extends IService<ProductInfoDo> {

    PageResult getMaterialList(Map<String, String> map);

    SingleResult addInit();

    ProductAddReq add(ProductAddReq req, Long userId,Long companyId);

    SingleResult updateInit(Long id);

    void deleteProductFile(Long id);

    ProductUpdateReq update(ProductUpdateReq updateVo, Long userId,Long companyId);

    int delete(Long id, Long userId);

    ProductDetailRes detail(Long id);

    SingleResult pageInit();


    PageResult getListPage(Map<String, String> map);

    SingleResult importProductFile(MultipartFile file, Long userId, Long companyId) throws FileNotFoundException;

    String exportProductCodePdf(Long id, int count,HttpServletResponse response);

    void printBarCodePdf(Map<String, String> map, Long id, int length, int width, int count, HttpServletResponse response);

    PageResult getListPageAll(Map<String, String> map);

    void exportProduct(Map<String, String> map, HttpServletResponse response) throws IOException;

    ProductInfoDo getProductDo(String sellerSKu, Long companyId);

    ProductDetailRes detailAll(Long id);

    Long getProductId(String subCode, Long companyId);

    List<OrderOutputProductAddReq> getProductDoReturnAddReq(String sku, Integer quantity, Long companyId);

    Collection<? extends OrderOutputProductAddReq> getAddProductListByPlatformSku(Long companyId, Date dateTime, String orderNumber, String number, Integer units);

    Long getProductIdNoThrow(String sellerSKu, Long companyId);

    Map<Long, String> getProductListMap(Long companyId);
}
